/* GLStringFactory.h
 *
 * --
 * Copyright (c) 2012, Christophe Huriaux
 * Distributed under the terms of the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * --
 */

#include <string>
#include <graphics/GLTexture.h>
#include <graphics/GLVertexArrayTexture.h>
#include <graphics/GLVertexDataLocal.h>
#include <utils/glvector.h>

#ifndef GLSTRINGFACTORY_H_
#define GLSTRINGFACTORY_H_

class GLStringFactory
{
	std::string str;
	int x;
	int y;
	GLTexture* font;
	GLVertexDataLocal<vector2d>* stringVertices;
	GLVertexDataLocal<vector2d>* texCoords;
	GLVertexArrayTexture<vector2d, vector2d>* vertexArrayString;

public:
	GLStringFactory(int x, int y, const char* str);
	GLStringFactory(unsigned int fontId, int x, int y, const char* str);
	~GLStringFactory();

	GLStringFactory& setString(const char* s);
	GLStringFactory& setString(std::string& s);
	GLStringFactory& setFont(unsigned int id);
	GLStringFactory& setPosition(int x, int y);
	void display();

private:
	void updateVerticesArray();
};

#endif /* GLSTRINGFACTORY_H_ */
